package com.temp.dto;

import lombok.Data;

@Data
public class SearchCampaignDTO {
    private String title;
    private Long categoryId;
    private String status;
    private Long userId;
    private String condition;

    private String visibility;
    private int pageSize;
    private int page;
    private int offset;

    public void formatParam() {
        this.page = this.page <= 0 ? -1 : this.page;
        this.pageSize = this.pageSize <= 0 ? -1 : this.pageSize;
        if(this.page > 0 && this.pageSize > 0) {
            this.offset = (this.page - 1) * this.pageSize;
        }
    }
}
